/*
 * List.h
 *
 *  Created on: 11/11/2011
 *      Author: marcio
 */

#ifndef LIST_H_
#define LIST_H_


typedef struct{
	void* head;
	void* last;
}List;

List* list_newList();

int list_addFirst(List* l, void* elem);

int list_addLast(List* l, void* elem);

void* list_getElemFirst(List* l);

void* list_getElemLast(List* l);

int list_removeElemFirst(List* l);

void list_remove(List* l, void* elem);

int list_search(List* l, void* elem, int (*lookfor)(void*, void*));

int list_removeElemLast(List* l);

int list_iterateModify(List* l, void* (*function)(void*));

List* list_iterate(List* l, void* (*function)(void*));

int list_order(List* l, int (*function)(void*, void*));

int list_isEmpty(List* l);

void* list_toArray(List* l);

#endif /* LIST_H_ */
